package com.moon.icoresso.api.impl;

import com.moon.icoresso.Exception.OauthException;
import com.moon.icoresso.api.UserInfoApi;
import com.moon.icoresso.pojo.dto.OauthUserInfo;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

/**
 * @ClassName UserInfoImpl
 * @Description
 * @Author menbbo
 * @Date 2021/2/13 12:49
 * @Version V1.0
 **/
@Component
public class UserInfoImpl implements UserInfoApi{
    @Override
    public OauthUserInfo getUserInfoByUserIdAndPassword(String userId, String password) {
        //模拟获取用户信息
        OauthUserInfo oauthUserInfo = new OauthUserInfo();
        if(userId.equals(password)){
            oauthUserInfo.setUserName("张三");
            oauthUserInfo.setEmail("men@163.com");
            oauthUserInfo.setTel("1519103355");
        }else{
            throw new OauthException("用户名与密码不匹配");
        }
        return oauthUserInfo;
    }
}